/**
 * 
 */
package edu.sjtu.seda.stage;

import java.io.IOException;
import java.util.Properties;

/**
 * @author john.zhu
 *
 */
public class StageConfigImpl implements StageConfig {
//	private int eventQueueSize = 10;
//	private int threadPoolSize = 5;
//	private boolean batchEnable = false;
//	private int batchSize = 10;
	private Properties prop = new Properties();
	
	public StageConfigImpl(){
		this("configuration.properties");
	}
	
	public StageConfigImpl(String filename){
		try {
			prop.load(ClassLoader.getSystemResourceAsStream(filename));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public String getProperty(String key){
		return prop.getProperty(key);
	}
	
	public int getInt(String key){
		return Integer.parseInt(prop.getProperty(key));
	}
	
	public boolean getBoolean(String key){
		return Boolean.parseBoolean(prop.getProperty(key));
	}
	
}
